#!/usr/bin/python3

import sys

from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QTabWidget, QVBoxLayout, QStatusBar

from attestat_attachment import AttestatAttachment
from attestat_face import AttestatFace
from attestat_marks import AttestatMarks


class App(QMainWindow):
    def __init__(self):
        super().__init__()
        self.title = 'МОС печать аттестатов'
        self.setWindowTitle(self.title)
        self.statusBar = QStatusBar()
        self.setStatusBar(self.statusBar)
        self.statusBar.showMessage("Выберите действие")
        self.tab_widget = MyTabWidget(self, self.statusBar)
        self.setCentralWidget(self.tab_widget)
        self.setMinimumWidth(600)
        self.setMinimumHeight(300)

        self.tab_widget.statusBar = self.statusBar
        self.show()


class MyTabWidget(QWidget):
    def __init__(self, parent, statusBar):
        super(QWidget, self).__init__(parent)
        self.statusBar = statusBar
        self.layout = QVBoxLayout(self)

        self.tabs = QTabWidget()
        self.tab1 = AttestatFace(self.statusBar)
        self.tab2 = AttestatAttachment(self.statusBar)
        self.tab3 = AttestatMarks(self.statusBar)
        self.tabs.resize(300, 200)
        self.tabs.currentChanged.connect(lambda: self.statusBar.showMessage('Выберите действие'))

        # Add tabs
        self.tabs.addTab(self.tab1, "Основной аттестат")
        self.tabs.addTab(self.tab2, "Приложение - информация")
        self.tabs.addTab(self.tab3, "Приложение - оценки")
        self.layout.addWidget(self.tabs)


if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = App()
    sys.exit(app.exec_())

